<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 使用proxy代理Map结构其实和Set结构原理基本相同了，可以参考15-3.html
        let map = new Map();

        let proxy = new Proxy(map, {
            get(target, key) {
                let value = target[key];
                if (typeof value == "function"){
                    return value.bind(target);
                }
                return value;
            }
        });

        proxy.set(['name','mikaisa']);
        proxy.set(['age','18']);
        console.log(map);//你会发现上面的赋值生效了
    </script>
</body>

</html>